{template '_header'}

<style>
    .input-group-sm.daterange .btn {padding: 4px 6px; border-radius: 0;}
    .trhead {
        border-left: 1px solid #e7eaec;
        border-right: 1px solid #e7eaec;
        background: #f8f8f8;
    }
</style>

<div class='page-heading'><h2>签到/奖励记录 <small>({$total}条/总积分:{$count}分)</small></h2></div>

<form action="./index.php" method="get" class="form-horizontal" plugins="form">
    <input type="hidden" name="c" value="site">
    <input type="hidden" name="a" value="entry">
    <input type="hidden" name="m" value="ewei_shopv2">
    <input type="hidden" name="do" value="web">
    <input type="hidden" name="r" value="sign.records">
    <div class="page-toolbar row m-b-sm m-t-sm">
        <div class="col-sm-2">
            <div class="input-group input-group-sm">
                <button class="btn btn-default btn-sm" type="button" data-toggle="refresh" title="刷新页面"><i class="fa fa-refresh"></i></button>
            </div>
        </div>
        <div class="col-sm-10 pull-right">
            <div class="input-group pull-right" style="width: 260px;">
                <input type="text" class="input-sm form-control" name="keyword" value="{$_GPC['keyword']}" placeholder="请输入昵称/手机号进行搜索"> <span class="input-group-btn">
                <button class="btn btn-sm btn-primary" type="submit"> 搜索</button> </span>
            </div>
            <div class="input-group input-group-sm pull-right daterange" style="width: 400px;">
                <select class="input-group-addon" style="width: 90px" name="type">
                    <option value="-1" {if $_GPC['type']==-1}selected{/if}>类型</option>
                    <option value="0" {if $_GPC['type']=='0'}selected{/if}>日常签到</option>
                    <option value="1" {if $_GPC['type']==1}selected{/if}>连签奖励</option>
                    <option value="2" {if $_GPC['type']==2}selected{/if}>总签奖励</option>
                </select>
                <select class="input-group-addon" style="width: 100px" name="searchtime">
                    <option value="" {if empty($_GPC['searchtime'])}selected{/if}>不按日期</option>
                    <option value="1" {if !empty($_GPC['searchtime'])}selected{/if}>搜索日期</option>
                </select>
                {php echo tpl_form_field_daterange('time', array('starttime'=>date('Y-m-d', $starttime),'endtime'=>date('Y-m-d', $endtime)), false);}
            </div>
        </div>
    </div>
</form>

<table class="table table-responsive table-bordered">
    <tbody>
        <tr class="trhead">
            <td style="width: 80px;">ID</td>
            <td style="width: 180px;">用户</td>
            <td style="width: 80px;">类型</td>
            <td style="width: 90px;">获得积分</td>
            <td>备注</td>
            <td style="width: 145px;">签到时间</td>
        </tr>
        {if empty($list)}
            <tr>
                <td colspan="5" align="center" style="line-height: 50px;">未查询到相关记录!</td>
            </tr>
        {else}
            {loop $list $item}
                <tr class="trbody">
                    <td>{$item['id']}</td>
                    <td>
                        <a href="{php echo webUrl('member/list/detail', array('id'=>$item['mid']))}" target="_blank" title="{$item['nickname']}"><img src="{$item['avatar']}" style="width:30px; height:30px; padding: 1px; border:1px solid #ccc;"> {$item['nickname']}</a>
                    </td>
                    <td>
                        {if $item['type']==0}日常签到{elseif $item['type']==1}连签奖励{elseif $item['type']==2}总签奖励{/if}
                    </td>
                    <td><a href="{php echo webUrl('finance/credit/credit1', array('keyword'=>$item['nickname']))}" target="_blank">+{$item['credit']}</a></td>
                    <td data-toggle="popover" data-html="true" data-placement="top" data-trigger="hover" data-content="{$item['log']}" data-original-title="" title="">{$item['log']}</td>
                    <td>{php echo date('Y.m.d H:i:s', $item['time'])}</td>
                </tr>
            {/loop}
        {/if}
    </tbody>
</table>
{$pager}


{template '_footer'}